Developer Documentation

QuickTime 4 API Documentation

QuickTime 4 Reference

| Previous | Chapter Contents | Chapter Top | Next |

Building Input Maps

The first step in creating an input map is to create a new QTAtomContainer to hold the map. You use the standard QuickTime container creation function:

QTNewAtomContainer(&inputMap);

For each source you are creating, you need to call the AddTrackReference function. The track IDs of the effects track and the source track are passed as parameters to AddTrackReference , which creates an atom of type kTrackModifierReference and returns an index number. You use this index as the ID of the atom when you need to refer to it. You then insert the reference into the input map as an atom of type kTrackModifierInput .

The code in Listing 2 creates a reference to the track firstSourceTrack , and adds it to the input map.

Listing 2 Adding an input reference atom to an input map

AddTrackReference(theEffectsTrack,
                 firstSourceTrack,
                 kTrackModifierReference,
                 &referenceIndex);

QTInsertChild(inputMap,
            kParentAtomIsContainer,
            kTrackModifierInput,
            referenceIndex,
            0,
            0,
            nil,
            &inputAtom);

The QTInsertChild function returns the offset of the new modifier input atom in the inputAtom parameter.

You now need to add the name and type of the source track to the modifier input atom. Again, calling the QTInsertChild function does this, as shown in the following source code:

inputType = VideoMediaType;
QTInsertChild(inputMap,
            inputAtom,
            kTrackModifierType,
            1,
            0,
            sizeof(inputType),
            &inputType,
            nil);

aType = 'srcA';
QTInsertChild(inputMap,
            inputAtom,
            kEffectDataSourceType,
            1,
            0,
            sizeof(aType),
            &aType,
            nil);

This process is repeated for each source for the effect.


© 1999 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |